package edu.hawaii.duedates;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 * Tests the Mailer class used for sending out emails.
 * 
 * @author John Ly
 * @author Ka Hung Phillip Lau
 */
public class TestMailer {

  /**
   * Tests the send of Mailer.
   */ 
  @Test
  public void testSend() {
    Mailer mail = new Mailer();
    String host = "mail.hawaii.edu";
    String emailAddr = "klau4@hawaii.edu";
    assertTrue("Test sendMail", mail.send(emailAddr, host, "DueDates Test"));
  }

  /**
   * Tests the send exception of Mailed.
   */
  @Test
  public void testSendFailedException() {
    Mailer mail = new Mailer();
    String host = "mail.hawaii.edu";
    String emailAddr = "what@hawaii.edu";
    assertFalse("Test sendMail", mail.send(emailAddr, host, "DueDates Test"));
  }
}

